package org.jvending.provisioning.stocking.par.impl;

public class UserDescriptionsTypeHandler extends org.apache.ws.jaxme.impl.JMSAXElementParser {
  /** The current state. The following values are valid states:
   *  0 = Before parsing the element
   *  1 = While or after parsing the child element {http://java.sun.com/xml/ns/j2ee-cp}display-name
   *  2 = While or after parsing the child element {http://java.sun.com/xml/ns/j2ee-cp}description
   *  3 = While or after parsing the child element {http://java.sun.com/xml/ns/j2ee-cp}icon
   * 
   */
  private int __state;


  public boolean startElement(java.lang.String pNamespaceURI, java.lang.String pLocalName, java.lang.String pQName, org.xml.sax.Attributes pAttr) throws org.xml.sax.SAXException {
    org.apache.ws.jaxme.impl.JMUnmarshallerHandlerImpl _1 = getHandler();
    switch (__state) {
      case 0:
        if ("http://java.sun.com/xml/ns/j2ee-cp".equals(pNamespaceURI)  &&  "display-name".equals(pLocalName)) {
          __state = 1;
          org.apache.ws.jaxme.JMManager _2 = getHandler().getJMUnmarshaller().getJAXBContextImpl().getManagerS(org.jvending.provisioning.stocking.par.DisplayName.class);
          java.lang.Object _3 = _2.getElementS();
          org.apache.ws.jaxme.impl.JMSAXElementParser _4 = _2.getHandler();
          _4.init(_1, _3, "http://java.sun.com/xml/ns/j2ee-cp", "display-name", _1.getLevel());
          _4.setAttributes(pAttr);
          _1.addElementParser(_4);
          return true;
        } else if ("http://java.sun.com/xml/ns/j2ee-cp".equals(pNamespaceURI)  &&  "description".equals(pLocalName)) {
          __state = 2;
          org.apache.ws.jaxme.JMManager _5 = getHandler().getJMUnmarshaller().getJAXBContextImpl().getManagerS(org.jvending.provisioning.stocking.par.Description.class);
          java.lang.Object _6 = _5.getElementS();
          org.apache.ws.jaxme.impl.JMSAXElementParser _7 = _5.getHandler();
          _7.init(_1, _6, "http://java.sun.com/xml/ns/j2ee-cp", "description", _1.getLevel());
          _7.setAttributes(pAttr);
          _1.addElementParser(_7);
          return true;
        } else if ("http://java.sun.com/xml/ns/j2ee-cp".equals(pNamespaceURI)  &&  "icon".equals(pLocalName)) {
          __state = 3;
          org.apache.ws.jaxme.JMManager _8 = getHandler().getJMUnmarshaller().getJAXBContextImpl().getManagerS(org.jvending.provisioning.stocking.par.Icon.class);
          java.lang.Object _9 = _8.getElementS();
          org.apache.ws.jaxme.impl.JMSAXElementParser _10 = _8.getHandler();
          _10.init(_1, _9, "http://java.sun.com/xml/ns/j2ee-cp", "icon", _1.getLevel());
          _10.setAttributes(pAttr);
          _1.addElementParser(_10);
          return true;
        }
        break;
      case 1:
        if ("http://java.sun.com/xml/ns/j2ee-cp".equals(pNamespaceURI)  &&  "display-name".equals(pLocalName)) {
          __state = 1;
          org.apache.ws.jaxme.JMManager _11 = getHandler().getJMUnmarshaller().getJAXBContextImpl().getManagerS(org.jvending.provisioning.stocking.par.DisplayName.class);
          java.lang.Object _12 = _11.getElementS();
          org.apache.ws.jaxme.impl.JMSAXElementParser _13 = _11.getHandler();
          _13.init(_1, _12, "http://java.sun.com/xml/ns/j2ee-cp", "display-name", _1.getLevel());
          _13.setAttributes(pAttr);
          _1.addElementParser(_13);
          return true;
        } else if ("http://java.sun.com/xml/ns/j2ee-cp".equals(pNamespaceURI)  &&  "description".equals(pLocalName)) {
          __state = 2;
          org.apache.ws.jaxme.JMManager _14 = getHandler().getJMUnmarshaller().getJAXBContextImpl().getManagerS(org.jvending.provisioning.stocking.par.Description.class);
          java.lang.Object _15 = _14.getElementS();
          org.apache.ws.jaxme.impl.JMSAXElementParser _16 = _14.getHandler();
          _16.init(_1, _15, "http://java.sun.com/xml/ns/j2ee-cp", "description", _1.getLevel());
          _16.setAttributes(pAttr);
          _1.addElementParser(_16);
          return true;
        } else if ("http://java.sun.com/xml/ns/j2ee-cp".equals(pNamespaceURI)  &&  "icon".equals(pLocalName)) {
          __state = 3;
          org.apache.ws.jaxme.JMManager _17 = getHandler().getJMUnmarshaller().getJAXBContextImpl().getManagerS(org.jvending.provisioning.stocking.par.Icon.class);
          java.lang.Object _18 = _17.getElementS();
          org.apache.ws.jaxme.impl.JMSAXElementParser _19 = _17.getHandler();
          _19.init(_1, _18, "http://java.sun.com/xml/ns/j2ee-cp", "icon", _1.getLevel());
          _19.setAttributes(pAttr);
          _1.addElementParser(_19);
          return true;
        }
        break;
      case 2:
        if ("http://java.sun.com/xml/ns/j2ee-cp".equals(pNamespaceURI)  &&  "description".equals(pLocalName)) {
          __state = 2;
          org.apache.ws.jaxme.JMManager _20 = getHandler().getJMUnmarshaller().getJAXBContextImpl().getManagerS(org.jvending.provisioning.stocking.par.Description.class);
          java.lang.Object _21 = _20.getElementS();
          org.apache.ws.jaxme.impl.JMSAXElementParser _22 = _20.getHandler();
          _22.init(_1, _21, "http://java.sun.com/xml/ns/j2ee-cp", "description", _1.getLevel());
          _22.setAttributes(pAttr);
          _1.addElementParser(_22);
          return true;
        } else if ("http://java.sun.com/xml/ns/j2ee-cp".equals(pNamespaceURI)  &&  "icon".equals(pLocalName)) {
          __state = 3;
          org.apache.ws.jaxme.JMManager _23 = getHandler().getJMUnmarshaller().getJAXBContextImpl().getManagerS(org.jvending.provisioning.stocking.par.Icon.class);
          java.lang.Object _24 = _23.getElementS();
          org.apache.ws.jaxme.impl.JMSAXElementParser _25 = _23.getHandler();
          _25.init(_1, _24, "http://java.sun.com/xml/ns/j2ee-cp", "icon", _1.getLevel());
          _25.setAttributes(pAttr);
          _1.addElementParser(_25);
          return true;
        }
        break;
      case 3:
        if ("http://java.sun.com/xml/ns/j2ee-cp".equals(pNamespaceURI)  &&  "icon".equals(pLocalName)) {
          __state = 3;
          org.apache.ws.jaxme.JMManager _26 = getHandler().getJMUnmarshaller().getJAXBContextImpl().getManagerS(org.jvending.provisioning.stocking.par.Icon.class);
          java.lang.Object _27 = _26.getElementS();
          org.apache.ws.jaxme.impl.JMSAXElementParser _28 = _26.getHandler();
          _28.init(_1, _27, "http://java.sun.com/xml/ns/j2ee-cp", "icon", _1.getLevel());
          _28.setAttributes(pAttr);
          _1.addElementParser(_28);
          return true;
        }
        break;
      default:
        throw new java.lang.IllegalStateException("Invalid state: " + __state);
    }
    return false;
  }

  public void endElement(java.lang.String pNamespaceURI, java.lang.String pLocalName, java.lang.String pQName, java.lang.Object pResult) throws org.xml.sax.SAXException {
    org.jvending.provisioning.stocking.par.UserDescriptionsType _1 = (org.jvending.provisioning.stocking.par.UserDescriptionsType) result;
    switch (__state) {
      case 1:
        if ("http://java.sun.com/xml/ns/j2ee-cp".equals(pNamespaceURI)  &&  "display-name".equals(pLocalName)) {
          _1.getDisplayName().add(pResult);
          return;
        }
        break;
      case 2:
        if ("http://java.sun.com/xml/ns/j2ee-cp".equals(pNamespaceURI)  &&  "description".equals(pLocalName)) {
          _1.getDescription().add(pResult);
          return;
        }
        break;
      case 3:
        if ("http://java.sun.com/xml/ns/j2ee-cp".equals(pNamespaceURI)  &&  "icon".equals(pLocalName)) {
          _1.getIcon().add(pResult);
          return;
        }
        break;
      default:
        throw new java.lang.IllegalStateException("Illegal state: " + __state);
    }
  }

  public boolean isFinished() {
    switch (__state) {
      case 3:
      case 2:
      case 1:
      case 0:
        return true;
      default:
        return false;
    }
  }

}
